import cv2
import numpy as np

lena=cv2.imread("3\\lena_gray.jpg")

lena = cv2.bitwise_not(lena)



cv2.imshow("lena",lena)
cv2.waitKey()
cv2.destroyAllWindows()